package dragon.tagext.util;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class CurrentPath extends SimpleTagSupport {

	@Override
	public void doTag() throws JspException, IOException {
		JspContext jspContext = getJspContext();
		PageContext pageContext = (PageContext) jspContext;
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
		JspWriter out = jspContext.getOut();
		out.print(request.getRequestURL().toString());
	}

}
